//Wrapper for EE::Mesh
#pragma once
#include "stdafx.h"

namespace EsenthelNet
{
	public ref class Mesh : EsenthelNet::MeshLod {
	internal:
		Mesh(EE::Mesh m) {
			//mesh = new EE::Mesh();
			lod = &m;
		}
	public:
		Mesh() {
			lod = new EE::Mesh();
		}

		EsenthelNet::Mesh^ Create(int parts) {
			((EE::Mesh*)lod)->create(parts);
			return this;
		}

		EsenthelNet::MeshBase^ Base(int i) {
			EE::MeshBase* base = &((EE::Mesh*)lod)->base(i);
			MeshBase^ output =  gcnew EsenthelNet::MeshBase(base);
			return output;
		}

		EsenthelNet::Mesh^ SetMaterial(EsenthelNet::Material^ mat) {
			((EE::Mesh*)lod)->setMaterial(*mat->mat);
			return this;
		}

		EsenthelNet::Mesh^ SetRender() {
			((EE::Mesh*)lod)->setRender();
			return this;
		}

		bool SetBox() {
			return ((EE::Mesh*)lod)->setBox();
		}

		void Draw(EsenthelNet::Matrix^ mat) {
			((EE::Mesh*)lod)->draw(*mat->matrix);
		}

	};
}
